import { Input, Select } from 'antd';
const fields = [
    {
        props: {//传递给FormItem的属性
            name: 'username',//字段名
            label: '用户名',//标题名
            rules: [{ required: true, message: '请输入用户名' }]//校验规则
        }
    },
    {
        props: {//传递给FormItem的属性
            name: 'password',//字段名
            label: '密码',//标题名
            rules: [{ required: true, message: '请输入密码' }]//校验规则
        },
        EditComponent: Input.Password
    },
    {
        props: {//传递给FormItem的属性
            name: 'email',//字段名
            label: '邮箱',//标题名
            rules: [{ required: true, message: '请输入邮箱' }]//校验规则
        }
    },
    {
        props: {//传递给FormItem的属性
            name: 'phone',//字段名
            label: '手机号',//标题名
            rules: [{ required: true, message: '请输入手机号' }]//校验规则
        }
    },
    {
        props: {//传递给FormItem的属性
            name: 'gender',//字段名
            label: '性别',//标题名
            rules: [{ required: true, message: '请输入性别' }]//校验规则
        },
        Component: Select,
        componentProps: {
            children: [
                <Select.Option key={1} value={1}>男</Select.Option>,
                <Select.Option key={0} value={0}>女</Select.Option>
            ]
        }
    },
    {
        props: {//传递给FormItem的属性
            name: 'access',//字段名
            label: '角色',//标题名
            rules: [{ required: true, message: '请输入角色' }]//校验规则
        },
        Component: Select,
        componentProps: {
            children: [
                <Select.Option key="root"  value="root">超级管理员</Select.Option>,
                <Select.Option key="admin" value="admin">管理员</Select.Option>,
                <Select.Option key="member" value="member">普通会员</Select.Option>
            ]
        }
    }
]
export default fields;